-
-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add initial api lookup endpoint for entities with test #288
Conversation
The test will not pass because data is not pushed into bookbeainz_test. To pass the test, replace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, that's a good start!
Structure-wise, we will want to separate the website server and the API, meaning having the API be a separate Express server.
You'll want to copy src/server/app.js
and see what you need to keep in that file to have an express server running. You will also want to copy /routes.js
and keep only your new endpoints.
Finally, you can add a new section to config.json and config.example.json (and test.json) for the API; all the properties I can think of right now are port
and versionPrefix: '/v1/'
, that you will then be able to use in your code where appropriate.
@MonkeyDo, Please check it once again, mainly setup related things. I will try to complete the first-week work in this weekend. |
@MonkeyDo Insertion of data in the test database is creating some problem on running the test, please check it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a few comments of lines in the new api/app.js that are not useful for the API.
Also check for unused imports once they're deleted.
Solving an issue with uncaught exceptions that would break the test harness
To make sure no code in src/api or src/common depends on any code in src/server or src/client
Solving an issue with uncaught exceptions that would break the test harness
To make sure no code in src/api or src/common depends on any code in src/server or src/client
Add more tests
BB API
Run this initial setup for BB API.
Install dependencies using
npm install
To check the endpoint, run the project without docker with
npm run start-api
.Endpoints implemented:
http://localhost:9098/work/<bbid>
http://localhost:9098/work/<bbid>/aliases
http://localhost:9098/work/<bbid>/identifiers
To run the test for this endpoint use
npm test ./test/src/api/routes/test-work.js